<?php
$version_url = "http://version.phprpg.net";
$latestVersion = @file_get_contents($version_url);
$compare = version_compare($phprpg->version, $latestVersion);
switch($compare){
	default:
		$prefix = "<font color=\"green\">";
		$suffix = "</font>";
		$message = "You are using the latest version of phpRPG!";
		break;
	case -1:
		$prefix = "<font color=\"red\">";
		$suffix = "</font>";
		$message = "Your version is out of date. Please visit <a href=\"http://phprpg.net/\">phpRPG</a> and download the latest version.";
		break;
	case 1:
		$prefix = "<font color=\"orange\">";
		$suffix = "</font>";
		$message = "You are using a BETA build of phpRPG. Please do not use this on a live game as it may be unstable.";
		break;
}
$page->header();
$table = new table;

$table->cell("<strong>Your Version</strong>");
$table->cell($phprpg->version);
$table->cell("<strong>Latest Version</strong>");
$table->cell($latestVersion);
$table->build_row();

$table->cell($prefix.$message.$suffix,array("colspan" => "100%", "style" => "text-align: center"));
$table->build_row();

$table->output();
$page->footer();
?>